<template>
<div style="margin-left: 10px">
  <el-link :href="exportDataUrl" target="_blank">
    <el-button type="primary" size="mini">
      导出
    </el-button>
  </el-link>
</div>
</template>

<script>
export default {
  name: "exporter",
  props: {
    "tableName": {
      type: String
    }
  },
  mounted() {
    this.$api.exportData(this.tableName).then(res => {
      this.exportDataUrl = res.data.downloadUrl
    })
  },
  data() {
    return {
      exportDataUrl: ''
    }
  }
};
</script>

<style scoped>

</style>